#ifndef INPUTMAPPING_H
#define INPUTMAPPING_H

#include "InputTypes.h"
#include <QObject>
#include <QStringList>

class InputMapping : public QObject
{
  Q_OBJECT

public:
  InputMapping(const ButtonMap& buttonMap = ButtonMap(),
               const AxisMap& axisMap = AxisMap());

  int axisValue(const HalfAxisType& hat, int value) const;
  int axisValue(const QString& name, const HalfAxisType& hat, int value) const;
  QString axisName(const HalfAxisType& hat) const;
  QStringList axisNames(const HalfAxisType& hat) const;

  void press(const ButtonType& bt);
  void release(const ButtonType& bt);
  void movement(const HalfAxisType& hat, int value);

  ButtonMap mButtonMap;
  AxisMap mAxisMap;

signals:
  void buttonPress(QString name);
  void buttonRelease(QString name);
  void axisMovement(QString name, int value);
};

typedef QVector<InputMapping*> InputVector;

#endif
